package com.ruoyi.project.domain.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.base.Field;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@ApiModel("阶段字典配置表")
@TableName(value = "project_allocation ",autoResultMap = true)
public class ProjectAllocation extends Field {

    private static final long serialVersionUID = 1L;

    /** id */
    @TableField(fill = FieldFill.INSERT)
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;


    /** 绩效系数 */
    @Excel(name = "标准岗位绩效系数")
    private BigDecimal ratio;

    /** 绩效金额 */
    @Excel(name = "绩效金额")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal money;

    /** 绩效金额  质保部分的*/
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "#0.00")
    private BigDecimal warrantyMoney;


    /** 操作人id */
    @Excel(name = "操作人id")
    private Long operatorId;

    /** 操作人姓名 */
    @Excel(name = "操作人姓名")
    private String operatorName;

    /** 项目id */
    @Excel(name = "项目id")
    private String projectNo;

    //备注 标记
    private String remark;


    //管家婆项目id
    private String housekeeperProject;

    //管家婆项目名称
    private String housekeeperName;

    //岗位名称
    private String postName;

    //岗位id
    private Long postId;

    @TableField(exist = false)
    List<AllocationDetail> detailList ;


    //分配的权限 默认禁用  销售负责人给项目经理分配 项目经理给其他人分配
    @TableField(exist = false)
    private boolean oper = false ;

    //当前分配类型 扣除质保金部分和纯质保金部分
    private String  current;

    //审核人  关联配置表  从配置表获取需要哪些岗位的人审核postId（审核的岗位）和审核类型needPerson 是否必须全部审核人同意
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<Integer> audit;


}